﻿using System.Collections.Generic;

namespace RpcClient.Interface
{
    /// <summary>
    /// OOM实体映射
    /// </summary>
    public interface IMapperCollect : IMapperHandler
    {
        /// <summary>
        /// 获取实体映射方案
        /// </summary>
        /// <param name="scheme"></param>
        /// <returns></returns>
        IMapperScheme GetScheme(string scheme);
        /// <summary>
        /// 注册并获取实体映射方案
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="scheme"></param>
        /// <returns></returns>
        IMapperScheme Scheme<T>(string scheme) where T : IMapper;
        /// <summary>
        /// 获取方案的转换器
        /// </summary>
        /// <param name="scheme"></param>
        /// <returns></returns>
        IMapperHandler GetMapper(string scheme);

        To Mapper<From, To>(From form, To to, IMapperConfig config) where From : class;

        To Mapper<From, To>(From form, IMapperConfig config) where From : class;
        To[] Mapper<From, To>(From[] form, IMapperConfig config) where From : class;
        List<To> Mapper<From, To>(List<From> form, IMapperConfig config) where From : class;
    }
}